home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / expect / exp_main_exp.c < prev    next >
C/C++ Source or Header  |  1993-03-29  |  1KB  |  44 lines

  1. /* main.c - main() and some logging routines for expect
  2.  
  3. Written by: Don Libes, NIST, 2/6/90
  4.  
  5. Design and implementation of this program was paid for by U.S. tax
  6. dollars.  Therefore it is public domain.  However, the author and NIST
  7. would appreciate credit if this program or parts of it are used.
  8. */
  9.  
  10. #include "exp_conf.h"
  11. #include <stdio.h>
  12. #include "tcl.h"
  13. #include "exp_global.h"
  14. #include "exp_rename.h"
  15. #include "exp_command.h"
  16. #include "exp_log.h"
  17. #include "exp_main.h"
  18.  
  19. void
  20. main(argc, argv)
  21. int argc;
  22. char *argv[];
  23. {
  24.     Tcl_Interp *interp = Tcl_CreateInterp();
  25.  
  26.     exp_init(interp);
  27.     exp_parse_argv(interp,argc,argv);
  28.  
  29.     /* become interactive if requested or "nothing to do" */
  30.     if (exp_interactive) (void) exp_interpreter(interp);
  31.     else if (exp_cmdfile) exp_interpret_cmdfile(interp,exp_cmdfile);
  32.     /* assert(exp_cmdlinecmds != 0) */
  33. #if 0
  34.     /* become interactive if requested or "nothing to do" */
  35.     if (exp_interactive || (!exp_cmdfile && !exp_cmdlinecmds))
  36.         (void) exp_interpreter(interp);
  37.  
  38.     if (exp_cmdfile) exp_interpret_cmdfile(interp,exp_cmdfile);
  39. #endif
  40.  
  41.     exp_exit(interp,0);
  42. }
  43.  
  44.